]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - Super Polarity/ParticleEngine.cs
Implements polarity system
[rbdr/super-polarity] / Super Polarity / ParticleEngine.cs
index 5cf6bdb2dc7c6215cad1dc8a3d9e30bc6ef0aa34..0fced25f179873533b230e709d03e6e11c4c748a 100644 (file)
@@ -11,6 +11,7 @@ namespace SuperPolarity
     {
         private Random random;
         public Vector2 EmitterLocation { get; set; }
+        public Color Color;
         private List<Particle> particles;
         private List<Texture2D> textures;
 
@@ -20,6 +21,7 @@ namespace SuperPolarity
             this.textures = textures;
             this.particles = new List<Particle>();
             random = new Random();
+            Color = Color.Red;
         }
 
         private Particle GenerateNewParticle()
@@ -31,10 +33,7 @@ namespace SuperPolarity
                 1f * (float)(random.NextDouble() * 2 - 1));
             float angle = 0;
             float angularVelocity = 0.1f * (float)(random.NextDouble() * 2 - 1);
-            Color color = new Color(
-                (float)random.NextDouble(),
-                (float)random.NextDouble(),
-                (float)random.NextDouble());
+            Color color = Color;
             float size = (float)random.NextDouble();
 
             int ttl = 20 + random.Next(40);